// import Store from "@/store";
import ConstantTypeEnum from "@/components/constant/typeEnum"

export function getUserInfo() {
    // return Store.getters['auth/user'];
    return {};
}

export function isAdmin() {
    let userInfo = getUserInfo();
    return userInfo && userInfo.userType === ConstantTypeEnum.userType.admin;
}

export function isNormalUser() {
    let userInfo = getUserInfo();
    return userInfo && userInfo.userType === ConstantTypeEnum.userType.normalUser;
}

export function isMerchant() {
    let userInfo = getUserInfo();
    return userInfo && userInfo.userType === ConstantTypeEnum.userType.merchant;
}

// 函数封装
export const userFunc = {
    isAdmin,
    isNormalUser,
    isMerchant,
}